class Course
  include DataMapper::Resource
  storage_names[:default] = "Course"
  
  property :id,                 Serial
  property :title,              String,        :required => true, :length => 500
  property :icon_url,           String,        :length => 500
  property :course_category_id, Integer
  property :sector_id,          Integer
  property :start_date,         Date
  property :end_date,           Date
  property :duration,           Integer
  property :time_category_id,   Integer
  property :value,              Integer
  property :currency_id,        Integer
  property :summary,            String,        :required => true, :length => 500
  property :content,            Text,          :required => true, :lazy => false
  property :tags,               String,        :required => true, :length => 500
  timestamps :at

  belongs_to :course_category
  belongs_to :sector
  belongs_to :currency
  belongs_to :time_category
  has n, :course_objects
  has n, :course_posts
  has n, :classrooms
end
